prune: [scan-build] Initialize a variable
authorColin Walters <walters@verbum.org>
Wed, 16 Oct 2019 13:48:20 +0000 (13:48 +0000)
committerColin Walters <walters@verbum.org>
Wed, 16 Oct 2019 13:48:20 +0000 (13:48 +0000)
Another false positive because we only read this if `opt_keep_younger_than` is `TRUE`,
but let's initialize variables on general principle.

src/ostree/ot-builtin-prune.c

index 2f560d14b423b6e9021f5fd8045da941fad9b6ad..fd2ab05fda715365d644f8d081bbcfe132e2dd6c 100644 (file)
@@ -205,7 +205,7 @@ ostree_builtin_prune (int argc, char **argv, OstreeCommandInvocation *invocation
       g_autoptr(GHashTable) all_refs = NULL;
       g_autoptr(GHashTable) reachable = ostree_repo_traverse_new_reachable ();
       g_autoptr(GHashTable) retain_branch_depth = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-      struct timespec keep_younger_than_ts;
+      struct timespec keep_younger_than_ts = {0, };
       GHashTableIter hash_iter;
       gpointer key, value;